package com.vn.ld.common.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {
	
	private static SimpleDateFormat formatter = new SimpleDateFormat();
	public static String dateToString(Date date, String format) {
		formatter.applyPattern(format);
		return formatter.format(date);
	}
	
	public static Date stringToDate(String dateStr, String format) throws ParseException {
		formatter.applyPattern(format);
		return formatter.parse(dateStr);
	}
}
